package com.atguigu03.threadsafe.notsafe;

/**
 * ClassName: WindowsTest2
 * Package: com.atguigu03.threadsafe.notsafe
 * Description:
 *
 * @Author BuTang
 * @Create 2023/5/14 22:41
 * @Version 1.0
 */
public class WindowsTest2 {
    public static void main(String[] args) {
        Windows2 a = new Windows2();

        Thread b = new Thread(a);
       Thread c = new Thread(a);
//        Thread d= new Thread(a);

        b.start();
       c.start();
//        d.start();
    }
}

class Windows2 implements Runnable {
    private static int ticket = 100;
    @Override
    public void run() {
        for (int i = ticket; i >0 ; i--) {
            System.out.println(Thread.currentThread().getName() + "--"+ticket);
            ticket--;
        }
    }
}
